#!/usr/bin/python
# -*- coding: UTF-8 -*-

import dbus
import dbus.service
import dbus.glib
import gobject

class Service(dbus.service.Object):

   def __init__(self, session_bus, app):
      dbus.service.Object.__init__(self, session_bus, '/org/tapioca/Ereseva')
      self.app = app

   @dbus.service.method(dbus_interface='org.tapioca.Ereseva')
   def SetPresenceCustomMessage(self, custom_message):
      self.app.set_presence(custom_message=custom_message)


if __name__ == '__main__':
   session_bus = dbus.SessionBus()
   bus_name = dbus.service.BusName('org.tapioca.Ereseva', bus=session_bus)

   serv = Service(bus_name)

   mainloop = gobject.MainLoop()
   mainloop.run()

